package com.dps.metrics.exception;

public class ExtensionException extends RuntimeException {
    private String domain;
    private Long code;
    private String message;
    private Object data;
    private Throwable cause;

    public ExtensionException(EnumExceptionMessageFusionMetrics e) {
        this.code = e.getCode();
        this.message = e.getMessage();
    }

    public ExtensionException(Long code, String message) {
        this.code = code;
        this.message = message;
    }

    /**
     * @deprecated
     */
    @Deprecated
    public ExtensionException(Long code, String message, Object object, Throwable throwable) {
        this.code = code;
        this.message = message;
        this.data = object;
        this.cause = throwable;
    }

    public ExtensionException(String domain, Long code, String message) {
        this.domain = domain;
        this.code = code;
        this.message = message;
    }


    public String getDomain() {
        return this.domain;
    }

    public Long getCode() {
        return this.code;
    }

    public String getMessage() {
        return this.message;
    }

    public Object getData() {
        return this.data;
    }

    public Throwable getCause() {
        return this.cause;
    }

    public ExtensionException() {
    }

    public ExtensionException(String domain, Long code, String message, Object data, Throwable cause) {
        this.domain = domain;
        this.code = code;
        this.message = message;
        this.data = data;
        this.cause = cause;
    }
}

